package com.project.config;

import com.project.util.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {


        String os = System.getProperty("os.name").toLowerCase();
        if (os.contains("win")) {
            registry.addResourceHandler("/procureImg/**")
                    .addResourceLocations("file:D:/web-s/7/procure-java/procure/procureImg/");
        } else if (os.contains("nix") || os.contains("nux") || os.contains("aix")) {
            registry.addResourceHandler("/procureImg/**")
                    .addResourceLocations("file:/mnt/img/");
        }
    }

}
